
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <tuple>



using namespace std;

typedef struct data_type1{
    char a[2];
    short b;
    int c;
} Data_type1;// 8字节
typedef struct data_type2{
    short a;
    Data_type1 b; //Tips: 这部分按里面最大成员大小对齐 所以要补. 至于补多少……
    char c[2];
} Data_type2;// 16 字节，对于结构体中套结构体需要解析到最终的类型

typedef struct data_type3{
    short a;
    double b; 
    char c[2];
} Data_type3; // 24 字节  2 + 6 + 8 + 2 + 6 ,符合一般的字节对齐原则

int main(int argc, char *argv[])
{

    map<int,string> MAP1{{19,"Tom"},{23,"Tony"}};

    for (auto i:MAP1)
    {
        cout << i.second << ": " << i.first << endl;
    }

    int *p = new int {1};

    string str{"HelloWorld!\n"};

    cout << *p << " " << str << endl;

    int b[3] {1,2,3};

    int *pp = new int[3]{1,2,3};

    for (int i = 0;i < 3;i++)
    {
        cout << *(pp++) << endl;
    }

    vector<int> ki{3,4,5};

    for (auto i:ki)
    {
        cout << i++ << endl;
    }

    tuple<int,string,vector<int>> kl{12,"Tom",{7,8,9}};

    cout << get<0>(kl) << endl;
    cout << get<1>(kl) << endl;
    cout << get<2>(kl)[0] << endl;



    
    cout << " type1 size: " << sizeof(Data_type1) << " type2 size: " << sizeof(Data_type2) << " type3 size: " << sizeof(Data_type3) << endl;



    return 0;
}